package com.kuaidu.ll.quickreadnews.utils;

import android.content.Context;

/**
 * Created by liulei on 2017/7/14.
 */

public class ContextUtils {

    public static int dip2px(Context context,float dpValue){
        if (context == null){
            return 0;
        }
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int)(dpValue * scale + 0.5F);
    }
}
